<?php

namespace XYWY\Controller;

/**
 * AboutController类
 *
 * @since 1.0 <2015-10-21> SoChishun <14507247@qq.com> Added.
 */
class AnalystController extends AppbaseController {

    public function index($id = 10) {
        $aboutus_menu = DXA('POrgDocument/DocumentCategory')->select_tree(array('where' => array('pid' => 2, 'status' => 1)));
        $this->assign('aboutus_menu', $aboutus_menu);
        $service_menu = DXA('POrgDocument/DocumentCategory')->select_tree(array('where' => array('pid' => 36, 'status' => 1)));
        $this->assign('service_menu', $service_menu);
        $title=DXA('POrgDocument/DocumentCategory')->where(array('id'=>$id))->getField('title');
        $news_list = DXA('POrgDocument/Document')->get_paging_list(array('category_id' => $id), $show);
        $this->assign('title',$title);
        $this->assign('news_list', $news_list);
        $this->display();
    }

    function analyst_detail($id = 0) {
        
        $aboutus_menu = DXA('POrgDocument/DocumentCategory')->select_tree(array('where' => array('pid' => 2, 'status' => 1)));
        $this->assign('aboutus_menu', $aboutus_menu);
        $service_menu = DXA('POrgDocument/DocumentCategory')->select_tree(array('where' => array('pid' => 36, 'status' => 1)));
        $this->assign('service_menu', $service_menu);
        $data = $id ? DXA('POrgDocument/Document')->find($id) : array();
        if($data){
            $data['content']=  DXA('POrgDocument/DocumentContent')->get_content($id);
        }
        $this->assign('data', $data);        
        $title= $data? DXA('POrgDocument/DocumentCategory')->where(array('id'=>$data['category_id']))->getField('title'):'';
        $this->assign('title',$title);
        $this->display();
    }
}
